package com.zx.mq.work;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WorkSender {

    @Autowired
    AmqpTemplate rabbitTemplate;

    // 生产者
    public void send(String msg){

        System.out.println("Sender : " + msg);
        rabbitTemplate.convertAndSend("works", msg);
    }
}
